package day5;

import day4.teacher.MathTeacher;
import day4.teacher.PETeacher;
import day4.teacher.Teacher;

/**
 * @author oldliu
 * @since 1.0
 */
//检查
public class Investor {
    private String name;
    private String zhiwu;

    public Investor(String name, String zhiwu) {
        this.name = name;
        this.zhiwu = zhiwu;
    }

    //多态来改造
    public void judge(Teacher t) {
        t.selfIntro();
        t.giveLession();
        if (t instanceof MuiscTeacher) {
            ((MuiscTeacher) t).makeQu();
        }
        System.out.println(name + "认为" + t.getName() + "很不错");
    }
    //评价:扩展性差+重复的太多了
//    public void judge(MathTeacher m){
//        m.selfIntro();
//        m.giveLession();
//        System.out.println(name+"认为"+m.getName()+"很优秀");
//    }
//    public void judge(PETeacher m){
//        m.selfIntro();
//        m.giveLession();
//        System.out.println(name+"认为"+m.getName()+"很优秀");
//    }
//    public void judge(ZhengzhiTeacher m){
//        m.selfIntro();
//        m.giveLession();
//        System.out.println(name+"认为"+m.getName()+"很优秀");
//    }
}
